function avg_acc = gogo_poly(X1train, X2train, ytrain, gidtrain, ...
                             degree, C_param, gamma_param)
%GOGO Summary of this function goes here
%   Detailed explanation goes here
    avg_acc = 0;
    for gid=1:3
        clear tr_data; clear tr_label;
        clear te_data; clear te_label;
        [tr_data, tr_label, te_data, te_label] = ...
            generate_data_hellinger(X1train, X2train, ytrain, gidtrain, gid);
        
        % normalize before svm
        [tr_data, norm_params] = norm_data(tr_data);
        te_data= norm_data(te_data, norm_params);
        
        option_str = sprintf('-t 1 -d %d -c %d -g %f', degree, C_param, gamma_param); 
        e = svmtrain(tr_label, tr_data, option_str);
        [~, stats, ~] = svmpredict(te_label, te_data, e, '');
        acc = stats(1);
    
        avg_acc = avg_acc + acc;
    end
    avg_acc = avg_acc / 3;
end
